import yaml
import os


class DefaultConfig(object):
    def __init__(self, model_name="EAST"):
        self.root_path = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
        config_path = os.path.join(self.root_path, "config/config.yaml")
        with open(config_path) as f:
            parameters = yaml.load(f, Loader=yaml.FullLoader)
        self.data_set = parameters["data_set"]
        self.gpu = parameters["gpu"]
        self.batch_size = parameters["batch_size"]
        self.num_workers = parameters["num_workers"]
        self.lr = parameters["lr"]
        self.weight_decay = parameters["weight_decay"]
        self.max_epoch = parameters["max_epoch"]
        self.shuffle = parameters["shuffle"]
        self.factor = parameters["factor"]
        self.T_0 = parameters["T_0"]
        self.T_mult = parameters["T_mult"]
        self.patience = parameters["patience"]
        self.device = parameters["device"]
        self.model_path = os.path.dirname(os.path.dirname(config_path))+parameters["model_path"]




